//Copyright (c) Microsoft Corporation.  All rights reserved.

using System;
using System.Collections.Generic;
using System.Text;
using Eas.WebCrawler.Interfaces;

namespace Eas.WebCrawler.Test.Scenario {
    public class LogErrorAction : NMock2.IAction {
        public static List<string> errors = new List<string>();
        #region IInvokable Members

        public void Invoke(NMock2.Monitoring.Invocation invocation) {
            string error = ((ProcessingStateMessageEventArgs)invocation.Parameters[1]).Message;
            System.Diagnostics.Trace.WriteLine("ERROR: " + error);
            errors.Add(error);
        }

        #endregion

        #region ISelfDescribing Members

        public void DescribeTo(System.IO.TextWriter writer) {
            writer.WriteLine("Error Handler");
        }

        #endregion
    }
}
